//
//  LLTagModel.m
//  标签
//
//  Created by admin on 2018/12/10.
//  Copyright © 2018 LG. All rights reserved.
//

#import "LLTagModel.h"

@implementation LLTagModel

+ (instancetype)setTagWithTitle:(NSString *)title
{
    return [self setTagWithTitle:title fontSize:14];
}

+ (instancetype)setTagWithTitle:(NSString *)title fontSize:(CGFloat)fontSize
{
    LLTagModel *model = [[self alloc] init];
    model.title = title;
    model.fontSize = fontSize > 0 ? fontSize : 14;
    CGRect rect = [title boundingRectWithSize:CGSizeMake(MAXFLOAT, 30) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:model.fontSize]} context:nil];
    model.width = rect.size.width + 10;
    return model;
}

@end
